# 17级智能移动班 李翔宇  17114120208
class ThreeDimensionalVector:  # 定义三维坐标类
    def __init__(self, x, y, z):  # 定义构造方法
        self.x = x
        self.y = y
        self.z = z

    def __add__(self, v):
        ax = self.x+v.x
        ay = self.y+v.y
        az = self.z+v.z
        Vector3 = (ax, ay, az)  # 将结果转化位元组，方便显示。 因为是元组，所以这个值只能赋值一次
        return Vector3

    def __sub__(self, v):
        sx = self.x-v.x
        sy = self.y-v.y
        sz = self.z-v.z
        Vector3 = (sx, sy, sz)
        return Vector3

    def __mul__(self,  a):
        mx = (self.x)*a
        my = (self.y)*a
        mz = (self.z)*a
        Vector3 = (mx, my, mz)
        return Vector3

    def __truediv__(self, b):
        dx = self.x/b
        dy = self.y/b
        dz = self.z/b
        Vector3 = (dx, dy, dz)
        return Vector3


v1 = ThreeDimensionalVector(3, 4, 5)
v2 = ThreeDimensionalVector(5, 6, 7)
print("17级青软2班 李翔宇 17114120208\n三维向量运算：")
print("====================================")
print('Vector3', v1+v2)
print('Vector3', v1-v2)
print('Vector3', v1*3)
print('Vector3', v2/2)
print("====================================")
